﻿using System;
using System.Collections.Generic;
using Zocono.Infrastructure.Common;
using Zocono.WCS.Infrastructure.ApllicationDto.Enums;

namespace Zocono.WCS.Admin.Models.ConfigManager
{
    public class RouteDetailInfoPageData
    {
        public long ID { get; set; }
        public string Js_Id { get { return ID.ToString(); } }
        public long PrevionsID { get; set; }
        public string Js_PrevionsID { get { return PrevionsID.ToString(); } }
        public long RouteID { get; set; }
        public string Js_RouteID { get { return RouteID.ToString(); } }
        public string FromStation { get; set; }
        public string ToStation { get; set; }
        public bool IsStart { get; set; }
        public bool IsEnd { get; set; }
        /// <summary>
        /// 取值枚举EnumDispatchType
        /// </summary>
        public EnumDispatchType DispatchType { get; set; }
        public string FromEquipment { get; set; }
        public string FromCargo { get; set; }
        public string ToEquipment { get; set; }
        public string ToCargo { get; set; }

        /// <summary>
        /// 起始货位列
        /// </summary>
        public string FromCargoColumn { get; set; }
        public string Target { get { return $"{ToEquipment}({ToCargo})"; } }
        public string RouteInfo { get { return $"{FromStation}->{ToStation}"; } }
        /// <summary>
        /// 调度类型说明
        /// </summary>
        public string DispatchTypeDescription { get { return ((EnumDispatchType)Enum.Parse(typeof(EnumDispatchType), DispatchType.ToString())).GetDescription(); } }
        public int DispatchTypeId { get { return (int)Enum.Parse(typeof(EnumDispatchType), DispatchType.ToString()); } }
        public List<DispatchTypeSearchData> DispatchTypes { get; set; }

        public List<RouteInfoSearchData> RouteInfos { get; set; }
    }

    public class DispatchTypeSearchData
    {
        public int ID { get; set; }

        public string Desception { get; set; }
    }

    public class RouteInfoSearchData
    {
        public string ID { get; set; }
        public string FromStation { get; set; }
        public string ToStation { get; set; }
        public string RouteInfo { get { return $"{FromStation}->{ToStation}"; } }
    }

    public class RouteDetailInfoSearchData {

        public long ID { get; set; }
        public string js_ID { get { return ID.ToString(); } }
        public string ToEquipment { get; set; }
        public string ToCargo { get; set; }
        public string Target { get { return $"{ToEquipment}({ToCargo})"; } }
    }
}
